# -*- coding: utf-8 -*-            
# @Author : chenliang
# @Time : 2024/1/18 14:06

from Case.python_ui.Common.basepage import Basepage
from Case.python_ui.PageLocate.user_product_computing_locator import ProductComputingLocator
from Case.python_ui.PageLocate.user_product_blockstorage_locator import ProductBlockStorgeLocator
from Case.python_ui.Test_data.menu_name_data import MenuName
import random
from Case.python_ui.PageLocate.product_management_locator import ProductManagementLocator
from Case.python_ui.Pageobject.admin_product_managent_pages import ProductManagementPages

import time


class ProductBlockStorage(Basepage):

    # 根据tab菜单名称进行点击
    def click_my_resource_tab(self, tab_name):
        doc = '根据my resource页的tab菜单名字进行点击进入'
        time.sleep(5)
        self.wait_elevisble(ProductComputingLocator.my_resource_tab_list, doc)
        my_resource_tab_list = self.get_elements(ProductComputingLocator.my_resource_tab_list, doc)
        for i in my_resource_tab_list:
            print('*****:', i.text, type(i))
            if i.text == tab_name:
                print('++++:', i.text)
                i.click()
        time.sleep(2)

    # 根据产品名称进行点击
    def get_product_name_to_click(self, product_name):
        doc = '根据产品名称然后点击'
        prod_list = self.get_elements(ProductComputingLocator.my_resource_product_list, doc)
        time.sleep(2)
        for prod in prod_list:
            print('+++++:', prod.text)
            if prod.text == product_name:
                prod.click()
                break
        time.sleep(5)

    # tab页根据产品名称进行点击进入控制台
    def click_product_by_name(self, product_name):
        doc = 'tab页根据产品名称进行点击进入控制台'
        time.sleep(5)
        self.wait_elevisble(ProductComputingLocator.move_computing_create_new, doc)
        self.move_mouse_to_element(ProductComputingLocator.move_computing_create_new)
        time.sleep(2)
        self.get_product_name_to_click(product_name)
        time.sleep(2)


    # 进入Block Storage管理控制页
    def enter_block_storage_page(self, cmdopt):
        doc = 'Block Storge管理控制页'
        self.click_my_resource_tab('Storage')
        self.click_product_by_name(MenuName.block_name[cmdopt])
        self.switch_to_new_window()
        time.sleep(10)
        self.wait_elevisble(ProductBlockStorgeLocator.if_enter_block_storage_page, doc)
        print("iframe++++:",self.get_element(ProductBlockStorgeLocator.if_enter_block_storage_page, doc).text)
        #print("+++:", self.get_element(ProductBlockStorgeLocator.if_enter_block_storage_page, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_enter_block_storage_page, doc).text == MenuName.block_name[cmdopt]
        time.sleep(5)

     #订购私有云按量付费磁盘
    def create_private_cloud_disk(self):
        doc = '订购私有云按量付费磁盘'
        self.wait_elevisble(ProductBlockStorgeLocator.click_pay_as_you_go, doc)
        self.click_element(ProductBlockStorgeLocator.click_pay_as_you_go, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buy_now, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buy_now, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_terms_of_service, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_terms_of_service, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_pay, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_pay, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_payment_succ, doc)
        print("payment++++:", self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text == 'Thank you for your payment. You can view the order details in order management or open the console for related operations.'
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_user_center, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_user_center, doc)
        time.sleep(5)

    #变配私有云按量付费磁盘
    def update_private_cloud_disk(self):
        doc = '变配私有云按量付费磁盘'
        self.click_my_resource_tab('Storage')
        time.sleep(10)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_menu, doc)
        self.move_mouse_to_element(ProductBlockStorgeLocator.click_menu)
        time.sleep(5)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_modify, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_modify, doc)
        all_handles = self.driver.window_handles
        self.driver.switch_to.window(all_handles[2])
        time.sleep(20)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_add_capacity, doc)
        print("ADD++++:", self.get_element(ProductBlockStorgeLocator.click_add_capacity, doc).text)
        self.click_element(ProductBlockStorgeLocator.click_add_capacity, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buy_now, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buy_now, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_terms_of_service, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_terms_of_service, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_pay, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_pay, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_payment_succ, doc)
        print("payment++++:", self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text == 'Thank you for your payment. You can view the order details in order management or open the console for related operations.'
        time.sleep(5)
        all_handles = self.driver.window_handles
        self.driver.switch_to.window(all_handles[1])
        time.sleep(2)
        self.move_mouse_to_element(ProductBlockStorgeLocator.click_menu)
        time.sleep(2)
        # self.wait_elevisble(ProductBlockStorgeLocator.click_modify, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_release, doc)
        all_handles = self.driver.window_handles
        self.driver.switch_to.window(all_handles[3])
        time.sleep(20)
        # self.wait_elevisble(ProductBlockStorgeLocator.click_add_capacity, doc)
        # print("ADD++++:", self.get_element(ProductBlockStorgeLocator.click_release_again, doc).text)
        self.click_element(ProductBlockStorgeLocator.click_release_again, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_yes_release, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_release_success, doc)
        print("release_success++++:", self.get_element(ProductBlockStorgeLocator.if_release_success, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_release_success,doc).text == 'The resource has been released successfully.'
        time.sleep(2)


    #释放按量付费磁盘
    def release_cloud_disk(self):
        doc = '释放按量付费磁盘'
        self.click_my_resource_tab('Storage')
        time.sleep(10)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_menu, doc)
        self.move_mouse_to_element(ProductBlockStorgeLocator.click_menu)
        time.sleep(2)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_modify, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_release, doc)
        all_handles = self.driver.window_handles
        self.driver.switch_to.window(all_handles[2])
        time.sleep(20)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_add_capacity, doc)
        #print("ADD++++:", self.get_element(ProductBlockStorgeLocator.click_release_again, doc).text)
        self.click_element(ProductBlockStorgeLocator.click_release_again, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_yes_release, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_release_success, doc)
        print("release_success++++:", self.get_element(ProductBlockStorgeLocator.if_release_success, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_release_success, doc).text == 'The resource has been released successfully.'
        time.sleep(2)

     #订购私有云包年包月磁盘
    def create_private_subscription_cloud_disk(self):
        doc = '订购私有云包年包月磁盘'
        self.wait_elevisble(ProductBlockStorgeLocator.click_ecs_selector, doc)
        self.click_element(ProductBlockStorgeLocator.click_ecs_selector, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.select_ecs, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.select_ecs, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buy_now, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buy_now, doc)
        time.sleep(2)
        self.scroll_bar_operation(ProductBlockStorgeLocator.click_terms_of_service)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_terms_of_service, doc)
        print("terms++++:", self.get_element(ProductBlockStorgeLocator.click_terms_of_service, doc).text)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_terms_of_service, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.click_pay, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_pay, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_payment_succ, doc)
        print("payment++++:", self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text == 'Thank you for your payment. You can view the order details in order management or open the console for related operations.'
        time.sleep(2)

    #续订私有云包年包月磁盘
    def renew_private_subscription_cloud_disk(self):
        doc = '续订私有云包年包月磁盘'
        self.click_my_resource_tab('Storage')
        time.sleep(10)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_renew, doc)
        print("renew++++:", self.get_element(ProductBlockStorgeLocator.click_renew, doc).text)
        time.sleep(5)
        self.switch_to_new_window()
        time.sleep(20)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buy_now, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_terms_of_service, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_pay, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_payment_succ, doc)
        print("payment++++:", self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text == 'Thank you for your payment. You can view the order details in order management or open the console for related operations.'
        time.sleep(2)

    #变配私有云按量付费磁盘
    def update_private_subscription_cloud_disk(self):
        doc = '变配私有云包年包月磁盘'
        self.click_my_resource_tab('Storage')
        time.sleep(10)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_menu, doc)
        self.move_mouse_to_element(ProductBlockStorgeLocator.click_menu)
        time.sleep(2)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_modify, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_modify, doc)
        self.switch_to_new_window()
        time.sleep(20)
        #self.wait_elevisble(ProductBlockStorgeLocator.click_add_capacity, doc)
        print("ADD++++:", self.get_element(ProductBlockStorgeLocator.click_add_capacity, doc).text)
        self.click_element(ProductBlockStorgeLocator.click_add_capacity, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buy_now, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buy_now, doc)
        time.sleep(2)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_terms_of_service, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.click_pay, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_pay, doc)
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_payment_succ, doc)
        print("payment++++:", self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_payment_succ, doc).text == 'Thank you for your payment. You can view the order details in order management or open the console for related operations.'
        time.sleep(2)

    # 进入NAS管理控制页
    def enter_nas_file_system(self, cmdopt):
        doc = 'NAS File System管理控制页'
        self.click_my_resource_tab('Storage')
        self.click_product_by_name('NAS File System')
        self.switch_to_new_window()
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_enter_nas_file_system, doc)
        print("iframe++++:",self.get_element(ProductBlockStorgeLocator.if_enter_nas_file_system, doc).text)
        #print("+++:", self.get_element(ProductBlockStorgeLocator.if_enter_block_storage_page, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_enter_nas_file_system, doc).text == 'NAS File System'
        time.sleep(5)

    # 进入OSS管理控制页
    def enter_oss_page(self):
        doc = 'oss管理控制页'
        self.click_my_resource_tab('Storage')
        self.click_product_by_name('Object Storage Service')
        self.switch_to_new_window()
        time.sleep(2)
        self.wait_elevisble(ProductBlockStorgeLocator.if_oss_page, doc)
        print("iframe++++:",self.get_element(ProductBlockStorgeLocator.if_oss_page, doc).text)
        #print("+++:", self.get_element(ProductBlockStorgeLocator.if_enter_block_storage_page, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_oss_page, doc).text == 'Object Storage Service'
        time.sleep(5)

    # 进入oss控制台
    def enter_oss(self):
        doc = '进入ecs'
        self.click_element(ProductBlockStorgeLocator.click_menu_list, doc)
        time.sleep(20)
        self.wait_elevisble(ProductBlockStorgeLocator.click_oss, doc)
        time.sleep(2)
        self.click_element(ProductBlockStorgeLocator.click_oss, doc)
        time.sleep(2)
        for i in range(3):
            try:
                self.wait_elevisble(ProductBlockStorgeLocator.iframe_oss, doc)
                self.driver.switch_to.frame(self.get_element(ProductBlockStorgeLocator.iframe_oss, doc))
                self.wait_elevisble(ProductBlockStorgeLocator.click_buckets, doc)
                if self.get_element(ProductBlockStorgeLocator.click_buckets, doc).text == 'Buckets':
                    break
            except:
                continue
        time.sleep(5)

    #创建buckets
    def create_buckets(self):
        doc = '创建buckets'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buckets, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_org_str, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_org_str, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_create_buckets, doc)
        print('create:', self.get_element(ProductBlockStorgeLocator.click_create_buckets, doc).text)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_create_buckets, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.select_orgname, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.select_orgname, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.ensure_orgname, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.select_region, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.ensure_region, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.select_domain_name, doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.ensure_domain_name, doc)
        time.sleep(5)
        self.send_keys(ProductBlockStorgeLocator.input_bucket_name, 'aaa',doc)
        time.sleep(5)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_ok, doc)
        time.sleep(20)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buckets, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buckets, doc)
        time.sleep(20)
        self.wait_elevisble(ProductBlockStorgeLocator.if_bucket_name, doc)
        print('buc+:', self.get_element(ProductBlockStorgeLocator.if_bucket_name, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_bucket_name, doc).text == 'aaa'

    #查看bucket详情
    def view_buckets(self):
        doc = '查看bucket详情'
        assert self.get_element(ProductBlockStorgeLocator.if_bucket_name_str, doc).text == 'Bucket Name'
        print('org+:', self.get_element(ProductBlockStorgeLocator.if_org_str, doc).text)
        assert self.get_element(ProductBlockStorgeLocator.if_org_str, doc).text == 'Organization Name'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_bucket_name, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_overview_str, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_overview_str, doc).text == 'Overview'
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_bucket, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_bucket, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_ok, doc)
        time.sleep(5)

    #删除buckets
    def delete_buckets(self):
        doc = '删除buckets'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_bucket_name, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_bucket, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_bucket, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_ok, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_buckets, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buckets, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_bucket_name, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_bucket_name, doc).text != 'aaa'

    #set Hotlink Protection
    def set_hotlink_protection(self):
        doc = 'set Hotlink Protection'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_bucket_name, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_basic_setting, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_basic_setting, doc)
        time.sleep(5)
        self.scroll_bar_operation(ProductBlockStorgeLocator.click_hp_setting)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_hp_setting, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.input_hotlink, doc)
        self.send_keys(ProductBlockStorgeLocator.input_hotlink, 'www.123.com', doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_save_hotlink, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_save_hotlink, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_hotlink, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_hotlink, doc).text == 'www.123.com'
        time.sleep(5)
        self.scroll_bar_operation(ProductBlockStorgeLocator.click_delete_bucket)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_bucket, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_ok, doc)
        time.sleep(5)

    #创建删除文件夹
    def create_delete_directory(self):
        doc = '创建删除文件夹'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_bucket_name, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_object_management, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_object_management, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_create_directory, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_create_directory, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.input_directory_name, doc)
        self.send_keys(ProductBlockStorgeLocator.input_directory_name, 'ddd', doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_ok, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_directory, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_directory, doc).text == 'ddd/'
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.delete_directory, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.delete_directory, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_ok, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_no_data, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_no_data, doc).text == 'No data available.'
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_bucket, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_bucket, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_delete_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_delete_ok, doc)
        time.sleep(5)


    ## set http header
    def set_http_header(self):
        doc = 'set http header'
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_buckets, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.if_bucket_name, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.if_bucket_name, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_object_management, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_object_management, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_more, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_more, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_set_header, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_set_header, doc)
        time.sleep(5)
        self.wait_elevisble(ProductBlockStorgeLocator.click_ok, doc)
        self.move_mouse_to_click_element(ProductBlockStorgeLocator.click_ok, doc)
        self.wait_elevisble(ProductBlockStorgeLocator.if_header_succ, doc)
        assert self.get_element(ProductBlockStorgeLocator.if_header_succ, doc).text == 'The operation is successful.'





